<template>
  <div class="login-container">
    <div class="login-center">
      <div class="login-card">
        <h2 class="login-title">会员登录</h2>

        <form @submit.prevent="handleLogin" class="login-form">
          <div class="form-group">
            <input
              type="text"
              v-model="phone"
              placeholder="请输入手机号"
              class="form-input"
              required
            />
          </div>

          <div class="form-group">
            <input
              type="password"
              v-model="password"
              placeholder="请输入登录密码"
              class="form-input"
              required
            />
            <div class="eye"></div>
          </div>

          <div class="remember-me">
            <div>
              <input type="checkbox" id="remember" v-model="rememberMe" />
              <label for="remember">记住我</label>
            </div>
            <div class="forget-password">忘记密码</div>
          </div>

          <button type="submit" class="login-button">登录</button>
        </form>

        <div class="register-link">
          还没有账户，<a href="#" @click.prevent="goToRegister">立即注册</a>
        </div>

        <div class="divider-text">或使用以下方式登录</div>

        <div class="social-login">
          <div class="login login-1"></div>
          <div class="login login-2"></div>
          <div class="login login-3"></div>
        </div>
      </div>

      <div class="membership-benefits">
        <h2 class="login-title">会员权益</h2>
        <div class="benefits-list">
          <div class="list-contain" style="margin-bottom: 36px">
            <div class="list-box">
              <div class="box-icon box-icon1"></div>
              <div class="box-text">信息咨询与共享</div>
            </div>
            <div class="list-box">
              <div class="box-icon box-icon2"></div>
              <div class="box-text">商业拓展与合作</div>
            </div>
          </div>
          <div class="list-contain">
            <div class="list-box">
              <div class="box-icon box-icon3"></div>
              <div class="box-text">业务培训与提升</div>
            </div>
            <div class="list-box">
              <div class="box-icon box-icon4"></div>
              <div class="box-text">权益保护与维权</div>
            </div>
          </div>
        </div>

        <div class="membership-stats">
          <div class="stats-span">
            <span class="span500">500+</span>
            <span class="member">活跃会员</span>
          </div>
          <div class="join-button">加入会员</div>
        </div>

        <div class="support">
          <div class="support-links">遇到问题？</div>
          <div class="support-links">
            <img src="../assets/img/login/tel.png" alt="描述文本" />
            电话咨询
          </div>
          <div class="support-links">
            <img src="../assets/img/login/email.png" alt="描述文本" />
            邮件联系
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";

const phone = ref("");
const password = ref("");
const rememberMe = ref(true);

const handleLogin = () => {
  // Login logic here
  console.log(
    "Logging in with:",
    phone.value,
    password.value,
    rememberMe.value
  );
};

const goToRegister = () => {
  // Navigate to register page
  console.log("Redirect to register");
};

const callSupport = () => {
  // Call support logic
  console.log("Call support");
};

const emailSupport = () => {
  // Email support logic
  console.log("Email support");
};
</script>

<style scoped lang="scss">
.login-container {
  background-image: url("../assets/img/login/big-bg.png");
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-family: "MicrosoftYaHei";
  width: 100%;
  height: 1000px;
  margin: 0 auto;
}
.login-center {
  margin: 84px 146px;
  padding: 60px 100px;
  display: flex;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background: white;
  border-radius: 30px;
  height: 833px;
  width: 1629px;
}

.login-card {
  width: 522px;
  margin-right: 100px;
}

.login-title {
  text-align: center;
  color: #141933;
  font-size: 36px;
  font-weight: 600;
  margin-bottom: 56px;
}

.form-group {
  margin-bottom: 30px;
  position: relative;
}

.form-input {
  width: 100%;
  border: 1px solid #ddd;
  width: 522px;
  height: 90px;
  border-radius: 10px;
  padding: 0 30px;
  background: #f3f6f8;
  font-family: MicrosoftYaHei;
  font-size: 26px;
}

.form-input:focus {
  outline: none;
  border-color: #409eff;
}
.eye {
  width: 26px;
  height: 9.28px;
  background-image: url("../assets/img/login/eye.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: absolute;
  top: 40px;
  right: 30px;
}

.remember-me {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  height: 30px;
  font-size: 24px;
  color: #596070;
  .forget-password {
    color: #0071d9;
  }
}

.remember-me input {
  margin-right: 8px;
  width: 24px;
  height: 24px;
}

.login-button {
  width: 100%;
  height: 90px;
  padding: 12px;
  background-color: #cb2323;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 30px;
}

.login-button:hover {
  // background-color: #66b1ff;
}

.register-link {
  text-align: center;
  line-height: 22px;
  margin: 40px 0 60px;
  font-size: 26px;
  color: #737373;
}

.register-link a {
  color: #cb2323;
  text-decoration: none;
}

.divider-text {
  text-align: center;
  font-size: 26px;
  color: #999999;
  line-height: 22px;
}

.social-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 52px;
  margin-top: 30px;
  .login {
    width: 46px;
    height: 46px;
    background-size: 100% 100%;
  }
  .login-1 {
    background-image: url("../assets/img/login/login-1.png");
  }
  .login-2 {
    background-image: url("../assets/img/login/login-2.png");
  }
  .login-3 {
    background-image: url("../assets/img/login/login-3.png");
  }
}

.social-button {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
}

.social-button:hover {
  background-color: #f5f5f5;
}

.membership-benefits {
  width: 778px;
  margin-left: 30px;
}

.benefits-list {
  display: flex;
  flex-direction: column;
  .list-contain {
    display: flex;
    justify-content: space-between;
    height: 100px;
    .list-box {
      display: flex;
      .box-icon {
        width: 100px;
        height: 100px;
        background-size: 100% 100%;
      }
      .box-icon1 {
        background-image: url("../assets/img/login/login-4.png");
      }
      .box-icon2 {
        background-image: url("../assets/img/login/login-5.png");
      }
      .box-icon3 {
        background-image: url("../assets/img/login/login-6.png");
      }
      .box-icon4 {
        background-image: url("../assets/img/login/login-7.png");
      }
      .box-text {
        margin-left: 20px;
        color: #141933;
        font-size: 30px;
        display: flex;
        align-items: center;
      }
    }
  }
}

.membership-stats {
  background-image: url("../assets/img/login/bg-500.png");
  background-size: 100% 100%;
  height: 154px;
  width: 100%;
  margin: 60px 0;
  padding: 46px 82px 42px 77px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 10px;
  .stats-span {
    display: flex;
    align-items: center;
  }
  .span500 {
    font-size: 70px;
    color: #f4350f;
    font-weight: 600;
  }
  .member {
    margin-left: 26px;
    color: #f4350f;
    font-size: 32px;
  }
  .join-button {
    // position: absolute;
    color: #fff;
    background-color: #ff523f;
    border-radius: 60px;
    height: 66px;
    width: 184px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
  }
  .join-button:hover {
    // background-color: #85ce61;
  }
}

.support {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999999;
  font-size: 28px;
  gap: 48px;
}

.support-links {
  display: flex;
  img {
    height: 40px;
    width: 40px;
    margin-right: 18px;
  }
}
</style>